home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
5_11.lha
/
5_11
/
5_11a.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-08
|
642b
|
30 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
/ included within get_token() DELETE
efault:
if (isalpha(ch))
{
// read in the name
char namestring[100];
char *p = namestring;
for (*p++ = ch;
input.get(ch) &&
(isalnum(ch) || (ch == '_'));
*p++ = ch)
;
input.putback(ch);
*p = 0;
// save the name
curr_tok.cvalue = new char[p - namestring + 1];
strcpy(curr_tok.cvalue, namestring);
curr_tok.type = NAME;
// insert the name into the variable name table
name *n = variables->insert(curr_tok.cvalue);
n->lvalue = 0;
return;
}